<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<!-- jquery ui css start -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/upload/css/themes/base/jquery-ui.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/upload/js/jquery.ui.plupload/css/jquery.ui.plupload.css" type="text/css" />
<!-- jquery ui css end -->
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%><!-- 里面已经有必须要的jquery-1.10.2.min.js -->

<!-- 必要的js文件 start -->
<script type="text/javascript" src="${pageContext.request.contextPath }/static/upload/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/upload/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/upload/js/jquery.ui.plupload/jquery.ui.plupload.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/upload/js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/upload/js/i18n/zh_CN.js"></script>
<!-- 必要的js文件 end -->

<script type="text/javascript">
var modal=null;
$(function () {
	$('.tipMe').tooltip({'placement':'top'});
	
	
	$("#uploader").plupload({
		// General settings
		runtimes : 'html5,flash,silverlight,html4',
		url : '${ctx}/monitor/carved_discs_upload_file.do',
		file_data_name: 'file',
		// User can upload no more then 20 files in one go (sets multiple_queues to false)
		max_file_count: 20,
		
		chunk_size: '1MB',

		// Resize images on clientside if we can
		resize : {
			width : 200, 
			height : 200, 
			quality : 90,
			crop: true // crop to exact dimensions
		},
		
		filters : {
			// Maximum file size
			max_file_size : '1000MB',
			// Specify what files to browse for
			mime_types: [
				{title : "ZIP文件", extensions : "zip"}
			]
		},

		// Rename files by clicking on their titles
		rename: true,
		
		// Sort files
		sortable: true,

		// Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
		dragdrop: true,

		// Views to activate
		views: {
			list: true,
			thumbs: true, // Show thumbs
			active: 'thumbs'
		},

		  flash_swf_url : '${pageContext.request.contextPath }/static/upload/js/Moxie.swf',
		     
	        // Silverlight settings
	        silverlight_xap_url : '${pageContext.request.contextPath }/static/upload/js/Moxie.xap'
			
	}); 
	
		modal= $.scojs_modal({
			target:"#myModal"
		});	
		 $("button[data-dismiss='modal']").click(function(e) {
			 modal.close();
			 location.reload();
			}
		 );
		 
});

function changeTab(str){
	if(str=='history'){
		 window.location="${ctx}/monitor/carved_discs_history_list.do";
	}else if(str=='upload'){
		window.location="${ctx}/monitor/carved_discs_upload_list.do";
	}else{
		window.location="${ctx}/monitor/carved_discs_manage_list.do";
	}
 
}

$(function(){
	$('.tipMe').tooltip({'placement':'top'});
});
function search(form) {
	$(form).appendPagerParaStr();
	return true;
}

function uploadCarvedDiscs(){
	modal.show();
}



</script>
</head>
<body>
<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="javascript:void(0);">首页</a>
					</li>
					<li>
						<a href="javascript:void(0);">数据交换监控</a>
					</li>
						<li>
						<a href="javascript:void(0);">内外网数据监控</a>
					</li>
					<li>
						<a href="javascript:void(0);">刻盘管理</a>
					</li>
					<li class="active">上传管理</li>
				</ul>
			</div>

			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						 <div class="tabbable">
						    <ul class="nav nav-tabs" id="myTab">
								<li>
									<a data-toggle="tab" href="#home" onclick="changeTab('download')">
										<i class="icon-cloud-download bigger-110"></i>
										刻盘管理
									</a>
								</li>
								<li>
									<a data-toggle="tab" href="#" onclick="changeTab('history')">
									  <i class="icon-cloud bigger-110"></i>
										刻盘历史
									</a>
								</li>
								<li class="active">
									<a data-toggle="tab" href="#" onclick="changeTab('upload')">
									  <i class="green icon-cloud-upload bigger-110"></i>
										上传管理
									</a>
								</li>
							</ul>
						<div class="tab-content">
						<div class="widget-box">
							<div class="widget-header header-color-white">
								<div class="widget-toolbar no-border">
								   <a href="#" data-action="collapse">
										<i class="icon-chevron-up"></i>
									</a>
								</div>
							</div>

							<div class="widget-body">
								<div class="widget-main">
									<form id="searchForm" class="form-search" action="${ctx}/monitor/carved_discs_upload_list.do" method="post"  onsubmit="return search(this)">
										<div class="row mg-top12">
										
											<div class="col-xs-4">
												<div class="input-group">
													<span class="input-group-addon">开始时间</span>
													<span class="input-icon input-icon-right width-100">
													<input type="text" class="input-cal"   id="startCreated" name="startCreated" value="${param.startCreated}" 
														onfocus="WdatePicker({onpicked:function(){endCreated.focus();},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,maxDate:'#F{$dp.$D(\'endCreated\');}'})"
														style=""/>
													<i class="icon-calendar blue pointer" onclick="javascript:$('#startCreated').focus();"></i>
													</span>
												</div>
											</div>
											<div class="col-xs-4">
												<div class="input-group">
													<span class="input-group-addon">结束时间</span>
													<span class="input-icon input-icon-right width-100">
													<input type="text" class="input-cal" id="endCreated" name="endCreated" value="${param.endCreated}" 
														onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true, minDate:'#F{$dp.$D(\'startCreated\');}'})"/>
													<i class="icon-calendar blue pointer" onclick="javascript:$('#endCreated').focus();"></i>
													</span>
												</div>
											</div>
											<div class="col-xs-4">
												<div class="input-group">
													<span class="input-group-btn">
														<button type="submit" class="btn btn-purple btn-sm">
															<i class="icon-search icon-on-right bigger-110"></i>
															搜索
														</button>&nbsp;&nbsp;
														<a href="${ctx}/monitor/carved_discs_upload_list.do" class="btn btn-purple btn-sm">
															<i class="icon-refresh icon-on-right bigger-110"></i>
															清空
														</a>
													</span>
												</div>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
						
						<div class="hr hr12 hr-dotted"></div>
						<div class="alert alert-info">
							<a class="btn btn-primary btn-xs right" href="javascript:void(0)" onclick="uploadCarvedDiscs()"><i class="icon-download bigger-120"></i> 光盘文件上传&nbsp;</a>
							<a href="#" title="刷新" class="tipMe btn btn-xs btn-info pull-right" onclick="javascript:$.refresh();">
									<i class="icon-refresh"></i>刷新
							</a>
						</div>
                                           
						<div class="table-responsive">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<!-- <th class="center">
											<label>
											<input type="checkbox" class="ace" id="checkedAll"/>
											<span class="lbl"></span>
											</label>
										</th> -->
										<th style="white-space: nowrap;">序号</th>
										<th style="white-space: nowrap;">文件名称</th>
										<th style="white-space: nowrap;">上传时间</th>
										<th style="white-space: nowrap;">处理状态</th>
										<th style="white-space: nowrap;">解析状态</th>
										<th style="white-space: nowrap;">文件总大小</th>
										<th style="white-space: nowrap;">操作</th>
									</tr>
								</thead>

								<tbody>
									<c:forEach var="vo" items="${_data}" varStatus="sta">
									<tr id="msg_${vo.id}"> 
										<%-- <td class="center">
											<label>
											<c:if test="${vo.sendStatus == '0' || vo.sendStatus == '1' || vo.sendStatus == '3'}">
											<input type="checkbox" class="ace" value="${vo.id}"/>
											</c:if>
											<span class="lbl"></span>
											</label>
										</td> --%>
										 <td class="center">
									       ${sta.count}
									    </td>
									    <td>
									      ${vo.carvedName }             
									    </td>
									    <td>
									      ${si:fmtDate(vo.uploadDate)} 
									    </td>
										<td>
										  <c:if test="${vo.processStatus==null }">
										          未解析出消息
										  </c:if>
										   <c:if test="${vo.processStatus!=null }">
										     ${si:uploadProcessStatus(vo.processStatus) }
										  </c:if>
										</td>
										<td >
										  <c:if test="${vo.analyzeStatus=='0' }">
										      待解析
										  </c:if>
										   <c:if test="${vo.analyzeStatus=='1' }">
										      解析成功
										  </c:if>
										   <c:if test="${vo.analyzeStatus=='2' }">
										     <button class="tipMe btn btn-xs btn-danger" title="${vo.analyzeMsg }">解析失败</button>
										  </c:if>
										</td>
										<td >${si:formatByte(vo.filesize) }</td>
										<td>
										 <c:if test="${vo.analyzeStatus=='1' }">
										  <c:if test="${vo.processStatus==null }">
										     -----
										  </c:if>
										   <c:if test="${vo.processStatus!=null }">
										     <a href="${ctx}/monitor/carved_discs_upload_get/${vo.id}.do">文件详情</a>
										  </c:if>
										  
										  </c:if>
										</td>
									</tr>
									</c:forEach>
								</tbody>
							</table>
							<jsp:include page="/WEB-INF/view/common/pg.jsp">
								<jsp:param value="${ctx}/monitor/carved_discs_upload_list.do" name="url"/>
								<jsp:param value="${_total}" name="total"/>
								<jsp:param value="${_urlpara}" name="urlpara" />
							</jsp:include>
						</div>
					  </div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
<div id="myModal" class="modal fade" role="dialog" tabindex="-1"
			aria-labelledby="上传" aria-hidden="false">
			<div class="modal-dialog">
				<div class="modal-content">
					<form id="form" method="post" action="" style="height: 300px;">
						<div id="uploader">
							<p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
						</div>
						<br />
                        </form> 
					<div class="modal-footer wizard-actions no-margin">
					<span class="pull-left red">上传过程中，请不要关闭当前窗口！</span>
						<button class="btn btn-danger btn-sm pull-right"
							data-dismiss="modal">
							<i class="icon-remove"></i> 关闭
						</button>
					</div>
				</div>
			</div>
		</div>
</body>
</html>
